import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/special_list/apply_user_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/application/execute_entity.dart';


ApplyUserEntity $ApplyUserEntityFromJson(Map<String, dynamic> json) {
  final ApplyUserEntity applyUserEntity = ApplyUserEntity();
  final String? selectedJobList = jsonConvert.convert<String>(json['selectedJobList']);
  if (selectedJobList != null) {
    applyUserEntity.selectedJobList = selectedJobList;
  }
  final String? applyUserId = jsonConvert.convert<String>(json['applyUserId']);
  if (applyUserId != null) {
    applyUserEntity.applyUserId = applyUserId;
  }
  final String? applyUserName = jsonConvert.convert<String>(json['applyUserName']);
  if (applyUserName != null) {
    applyUserEntity.applyUserName = applyUserName;
  }
  final List<ExecuteTicketReceiptListOperatorLists>? guardianList = (json['guardianList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ExecuteTicketReceiptListOperatorLists>(e) as ExecuteTicketReceiptListOperatorLists).toList();
  if (guardianList != null) {
    applyUserEntity.guardianList = guardianList;
  }
  final String? ticketBigTypeId = jsonConvert.convert<String>(json['ticketBigTypeId']);
  if (ticketBigTypeId != null) {
    applyUserEntity.ticketBigTypeId = ticketBigTypeId;
  }
  final String? ticketBigTypeName = jsonConvert.convert<String>(json['ticketBigTypeName']);
  if (ticketBigTypeName != null) {
    applyUserEntity.ticketBigTypeName = ticketBigTypeName;
  }
  final String? ticketTypeId = jsonConvert.convert<String>(json['ticketTypeId']);
  if (ticketTypeId != null) {
    applyUserEntity.ticketTypeId = ticketTypeId;
  }
  final String? ticketTypeName = jsonConvert.convert<String>(json['ticketTypeName']);
  if (ticketTypeName != null) {
    applyUserEntity.ticketTypeName = ticketTypeName;
  }
  final bool? allowModification = jsonConvert.convert<bool>(json['allowModification']);
  if (allowModification != null) {
    applyUserEntity.allowModification = allowModification;
  }
  return applyUserEntity;
}

Map<String, dynamic> $ApplyUserEntityToJson(ApplyUserEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['selectedJobList'] = entity.selectedJobList;
  data['applyUserId'] = entity.applyUserId;
  data['applyUserName'] = entity.applyUserName;
  data['guardianList'] = entity.guardianList.map((v) => v.toJson()).toList();
  data['ticketBigTypeId'] = entity.ticketBigTypeId;
  data['ticketBigTypeName'] = entity.ticketBigTypeName;
  data['ticketTypeId'] = entity.ticketTypeId;
  data['ticketTypeName'] = entity.ticketTypeName;
  data['allowModification'] = entity.allowModification;
  return data;
}

extension ApplyUserEntityExtension on ApplyUserEntity {
  ApplyUserEntity copyWith({
    String? selectedJobList,
    String? applyUserId,
    String? applyUserName,
    List<ExecuteTicketReceiptListOperatorLists>? guardianList,
    String? ticketBigTypeId,
    String? ticketBigTypeName,
    String? ticketTypeId,
    String? ticketTypeName,
    bool? allowModification,
  }) {
    return ApplyUserEntity()
      ..selectedJobList = selectedJobList ?? this.selectedJobList
      ..applyUserId = applyUserId ?? this.applyUserId
      ..applyUserName = applyUserName ?? this.applyUserName
      ..guardianList = guardianList ?? this.guardianList
      ..ticketBigTypeId = ticketBigTypeId ?? this.ticketBigTypeId
      ..ticketBigTypeName = ticketBigTypeName ?? this.ticketBigTypeName
      ..ticketTypeId = ticketTypeId ?? this.ticketTypeId
      ..ticketTypeName = ticketTypeName ?? this.ticketTypeName
      ..allowModification = allowModification ?? this.allowModification;
  }
}
